package ejb.dto;

import java.util.List;


public class RoomDTO {
	
	private int id;
	private int beds;
	private String description;
	private String name;
	private List<HotelAvailabilityDTO> hotelAvailabilities;


	//GETTER AND SETTER
	
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getBeds() {
		return this.beds;
	}

	public void setBeds(int i) {
		this.beds = i;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<HotelAvailabilityDTO> getHotelAvailabilities() {
		return this.hotelAvailabilities;
	}

	public void setHotelAvailabilities(List<HotelAvailabilityDTO> hotelAvailabilities) {
		this.hotelAvailabilities = hotelAvailabilities;
	}

	//METHODS
	
	/**
	 * Add HotelAvailabilityDTO to list
	 * @param hotelAvailability
	 * @return list of HotelAvailability
	 */
	public HotelAvailabilityDTO addHotelAvailability(HotelAvailabilityDTO hotelAvailability) {
		getHotelAvailabilities().add(hotelAvailability);
		hotelAvailability.setRoom(this);

		return hotelAvailability;
	}

	/**
	 * Remove HotelAvailabilityDTO from list
	 * @param hotelAvailability
	 * @return list of HotelAvailabilityDTO
	 */
	public HotelAvailabilityDTO removeHotelAvailability(HotelAvailabilityDTO hotelAvailability) {
		getHotelAvailabilities().remove(hotelAvailability);
		hotelAvailability.setRoom(null);

		return hotelAvailability;
	}

}